import { axios } from '@/utils/request'

export function getUserMenus (params) {
  return axios({
    url: '/uniauth/resource/resources',
    method: 'get',
    params
  })
}

export function getRoleMenus (params) {
  return axios({
    url: '/experiment/role/roleResources',
    method: 'get',
    params
  })
}

export function updateRoleMenus (params) {
  return axios({
    url: '/experiment/role/setRoleResources',
    method: 'post',
    params
  })
}

export function getMenuList (params) {
  return axios({
    url: '/experiment/resources/list',
    method: 'get',
    params
  })
}

export function deleteMenuInfo (params) {
  return axios({
    url: '/experiment/resources/delete',
    method: 'delete',
    params
  })
}

export function getMenuInfo (params) {
  return axios({
    url: '/experiment/resources/one',
    method: 'get',
    params
  })
}

export function createMenuInfo (params) {
  return axios({
    url: '/experiment/resources/add',
    method: 'put',
    data: params
  })
}

export function updateMenuInfo (params) {
  return axios({
    url: '/experiment/resources/update',
    method: 'post',
    data: params
  })
}

export function getUserList (params) {
  return axios({
    url: '/experiment/user/page',
    method: 'get',
    params
  })
}

export function deleteUserInfo (params) {
  return axios({
    url: '/experiment/user/delete',
    method: 'delete',
    params
  })
}

export function getUserInfo (params) {
  return axios({
    url: '/experiment/user/one',
    method: 'get',
    params
  })
}

export function updateUserInfo (params) {
  return axios({
    url: '/experiment/user/update',
    method: 'post',
    data: params
  })
}

export function getOrgTree (params) {
  return axios({
    url: '/experiment/organization/list',
    method: 'get',
    params
  })
}

export function deleteOrgInfo (params) {
  return axios({
    url: '/experiment/organization/delete',
    method: 'delete',
    params
  })
}

export function getOrgInfo (params) {
  return axios({
    url: '/experiment/organization/one',
    method: 'get',
    params
  })
}

export function createOrgInfo (params) {
  return axios({
    url: '/experiment/organization/add',
    method: 'put',
    data: params
  })
}

export function updateOrgInfo (params) {
  return axios({
    url: '/experiment/organization/update',
    method: 'post',
    data: params
  })
}

export function getRoleList (params) {
  return axios({
    url: '/experiment/role/list',
    method: 'get',
    params
  })
}

export function deleteRoleInfo (params) {
  return axios({
    url: '/experiment/role/delete',
    method: 'delete',
    params
  })
}

export function getRoleInfo (params) {
  return axios({
    url: '/experiment/role/one',
    method: 'get',
    params
  })
}

export function createRoleInfo (params) {
  return axios({
    url: '/experiment/role/create',
    method: 'post',
    params
  })
}

export function updateRoleInfo (params) {
  return axios({
    url: '/experiment/role/update',
    method: 'post',
    params
  })
}

export function getGroupList (params) {
  return axios({
    url: '/experiment/group',
    method: 'get',
    params
  })
}

export function getGroupAllList (params) {
  return axios({
    url: '/experiment/group/getList',
    method: 'get',
    params
  })
}

export function deleteGroupInfo (params) {
  return axios({
    url: '/experiment/group',
    method: 'delete',
    params
  })
}

export function getGroupInfo (params) {
  return axios({
    url: '/experiment/group/getOne',
    method: 'get',
    params
  })
}

export function createGroupInfo (params) {
  return axios({
    url: '/experiment/group',
    method: 'post',
    params
  })
}

export function updateGroupInfo (params) {
  return axios({
    url: '/experiment/group',
    method: 'put',
    params
  })
}

export function resetPassword (params) {
  return axios({
    url: '/ac/users/randomPassword',
    method: 'put',
    params
  })
}

export function getUserResources (params) {
  return axios({
    url: '/ac/users/userResourcesList',
    method: 'get',
    params
  })
}

export function updateUserResources (params) {
  return axios({
    url: '/ac/users/updateUserResources',
    method: 'put',
    params
  })
}
